/*----------------------------------------------------------------------------------------
*
*  Copyright 2019, Gao Hai Hui, <fromzeropoint@126.com>.  All rights reserved.
*  https://gitee.com/helloworldghh/xoskit.git
*  Use of this source code is governed by a MIT license
*  that can be found in the License file.
*
----------------------------------------------------------------------------------------*/
#ifndef __A73A9FAB_3443_47b7_AD17_9372AAD346EB__
#define __A73A9FAB_3443_47b7_AD17_9372AAD346EB__

#include "../tools/head.h"

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

namespace xos
{

    class mgr : public i_xos
    {
    public:
        typedef release_impl< mgr > T;

    public:
        mgr();
        ~mgr();

    public:
        static int static_init( xos_container::i_container * pContainer, i_xos ** ppv );
        static xos_container::i_container * container();
        static i_xos * get();

    public:
        //
        // 需要释放
        // 
        i_dir_monitor * dir_monitor();
        i_dynamic * dynamic();

        i_thread * thread();
        i_time * tm();

        i_file * file();
        i_dir * dir();

        i_socket * socket();
        i_select * select();

        i_event * event();
        i_lock * mutex();
        i_lock * spin();

        //
        // 不用释放
        // 
        i_misc * misc();
        i_crt * crt();

        // 
        // get exe path
        // 
        const char * exe_path();

    public:
        int put_back_to_pool();
        int init();
        int term();
    };
} // xos

#endif // __A73A9FAB_3443_47b7_AD17_9372AAD346EB__
